home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / doom / turric03.zip / TURRIC03.ZIP / PROGS / SHALRATH.QC < prev    next >
Text File  |  1997-01-30  |  9KB  |  268 lines

  1. /*
  2. ==============================================================================
  3.  
  4. SHAL-RATH
  5.  
  6. ==============================================================================
  7. */
  8. $cd /raid/quake/id1/models/shalrath
  9. $origin 0 0 24
  10. $base base
  11. $skin skin
  12. $scale 0.7
  13.  
  14. $frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8
  15. $frame attack9 attack10 attack11
  16.  
  17. $frame pain1 pain2 pain3 pain4 pain5 
  18.  
  19. $frame death1 death2 death3 death4 death5 death6 death7
  20.  
  21. $frame    walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
  22. $frame    walk11 walk12
  23.  
  24. void() shalrath_pain;
  25. void() ShalMissile;
  26. void() shal_stand     =[      $walk1,       shal_stand    ] {ai_stand();};
  27.  
  28. void() shal_walk1     =[      $walk2,       shal_walk2    ] {
  29. if (random() < 0.2)
  30.     sound (self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE);
  31. ai_walk(6);};
  32. void() shal_walk2     =[      $walk3,       shal_walk3    ] {ai_walk(4);};
  33. void() shal_walk3     =[      $walk4,       shal_walk4    ] {ai_walk(0);};
  34. void() shal_walk4     =[      $walk5,       shal_walk5    ] {ai_walk(0);};
  35. void() shal_walk5     =[      $walk6,       shal_walk6    ] {ai_walk(0);};
  36. void() shal_walk6     =[      $walk7,       shal_walk7    ] {ai_walk(0);};
  37. void() shal_walk7     =[      $walk8,       shal_walk8    ] {ai_walk(5);};
  38. void() shal_walk8     =[      $walk9,       shal_walk9    ] {ai_walk(6);};
  39. void() shal_walk9     =[      $walk10,       shal_walk10    ] {ai_walk(5);};
  40. void() shal_walk10    =[      $walk11,       shal_walk11    ] {ai_walk(0);};
  41. void() shal_walk11    =[      $walk12,       shal_walk12    ] {ai_walk(4);};
  42. void() shal_walk12    =[      $walk1,       shal_walk1    ] {ai_walk(5);};
  43.  
  44. void() shal_run1     =[      $walk2,       shal_run2    ] {
  45. if (random() < 0.2)
  46.     sound (self, CHAN_VOICE, "shalrath/idle.wav", 1, ATTN_IDLE);
  47. ai_run(6);};
  48. void() shal_run2     =[      $walk3,       shal_run3    ] {ai_run(4);};
  49. void() shal_run3     =[      $walk4,       shal_run4    ] {ai_run(0);};
  50. void() shal_run4     =[      $walk5,       shal_run5    ] {ai_run(0);};
  51. void() shal_run5     =[      $walk6,       shal_run6    ] {ai_run(0);};
  52. void() shal_run6     =[      $walk7,       shal_run7    ] {ai_run(0);};
  53. void() shal_run7     =[      $walk8,       shal_run8    ] {ai_run(5);};
  54. void() shal_run8     =[      $walk9,       shal_run9    ] {ai_run(6);};
  55. void() shal_run9     =[      $walk10,       shal_run10    ] {ai_run(5);};
  56. void() shal_run10    =[      $walk11,       shal_run11    ] {ai_run(0);};
  57. void() shal_run11    =[      $walk12,       shal_run12    ] {ai_run(4);};
  58. void() shal_run12    =[      $walk1,       shal_run1    ] {ai_run(5);};
  59.  
  60. void() shal_attack1     =[      $attack1,       shal_attack2    ] {
  61. sound (self, CHAN_VOICE, "shalrath/attack.wav", 1, ATTN_NORM);
  62. ai_face();
  63. };
  64. void() shal_attack2     =[      $attack2,       shal_attack3    ] {ai_face();};
  65. void() shal_attack3     =[      $attack3,       shal_attack4    ] {ai_face();};
  66. void() shal_attack4     =[      $attack4,       shal_attack5    ] {ai_face();};
  67. void() shal_attack5     =[      $attack5,       shal_attack6    ] {ai_face();};
  68. void() shal_attack6     =[      $attack6,       shal_attack7    ] {ai_face();};
  69. void() shal_attack7     =[      $attack7,       shal_attack8    ] {ai_face();};
  70. void() shal_attack8     =[      $attack8,       shal_attack9    ] {ai_face();};
  71. void() shal_attack9     =[      $attack9,       shal_attack10   ] {ShalMissile();};
  72. void() shal_attack10    =[      $attack10,      shal_attack11   ] {ai_face();};
  73. void() shal_attack11    =[      $attack11,      shal_run1   ] {};
  74.  
  75. void() shal_pain1       =[      $pain1, shal_pain2      ] {};
  76. void() shal_pain2       =[      $pain2, shal_pain3      ] {};
  77. void() shal_pain3       =[      $pain3, shal_pain4      ] {};
  78. void() shal_pain4       =[      $pain4, shal_pain5      ] {};
  79. void() shal_pain5       =[      $pain5, shal_run1      ] {};
  80.  
  81. void() shal_death1      =[      $death1,        shal_death2     ] {};
  82. void() shal_death2      =[      $death2,        shal_death3     ] {};
  83. void() shal_death3      =[      $death3,        shal_death4     ] {};
  84. void() shal_death4      =[      $death4,        shal_death5     ] {};
  85. void() shal_death5      =[      $death5,        shal_death6     ] {};
  86. void() shal_death6      =[      $death6,        shal_death7     ] {};
  87. void() shal_death7      =[      $death7,        shal_death7    ] {};
  88.  
  89.  
  90. void() shalrath_pain =
  91. {
  92.     if (self.pain_finished > time)
  93.         return;
  94.  
  95.     sound (self, CHAN_VOICE, "shalrath/pain.wav", 1, ATTN_NORM);
  96.     shal_pain1();
  97.     self.pain_finished = time + 3;
  98. };
  99.  
  100. void() shalrath_die =
  101. {
  102. //** PATCH_BEGIN - gibbin3 - Turrican ****
  103. // Pass monster size and head.mdl to Corpse_die using globals.
  104.     self.corpse_size = SIZE_MEDIUM;
  105.     self.head_gib_name = "progs/h_shal.mdl";
  106. //** PATCH_END - gibbin3 - Turrican ******
  107.  
  108. // check for gib
  109.     if (self.health < -90)
  110.     {
  111. //** PATCH_BEGIN - gibbin3 - Turrican ****
  112.         Corpse_die();
  113. //** PATCH_END - gibbin3 - Turrican ******
  114.         return;
  115.     }
  116.  
  117.     sound (self, CHAN_VOICE, "shalrath/death.wav", 1, ATTN_NORM);
  118.     shal_death1();
  119. //** PATCH_BEGIN - gibbin3 ****
  120. //    self.solid = SOLID_NOT;
  121. //** PATCH_END - gibbin3 ******
  122.  
  123.     // insert death sounds here
  124.  
  125. //** PATCH_BEGIN - gibbin3 - Turrican ****
  126.     MakeCorpse (135, '-32 -32 -24', '32 32 -10');
  127. //** PATCH_END - gibbin3 - Turrican ******
  128.  
  129. };
  130.  
  131. /*
  132. ================
  133. ShalMissile
  134. ================
  135. */
  136. void() ShalMissileTouch;
  137. void() ShalHome;
  138. void() ShalMissile =
  139. {
  140.     local    entity     missile;
  141.     local    vector    dir;
  142.     local    float    dist, flytime;
  143.  
  144.     dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
  145.     dist = vlen (self.enemy.origin - self.origin);
  146.     flytime = dist * 0.002;
  147.     if (flytime < 0.1)
  148.         flytime = 0.1;
  149.  
  150.     self.effects = self.effects | EF_MUZZLEFLASH;
  151.     sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM);
  152.  
  153.     missile = spawn ();
  154.     missile.owner = self;
  155.  
  156.     missile.solid = SOLID_BBOX;
  157.     missile.movetype = MOVETYPE_FLYMISSILE;
  158.     setmodel (missile, "progs/v_spike.mdl");
  159.  
  160.     setsize (missile, '0 0 0', '0 0 0');        
  161.  
  162.     missile.origin = self.origin + '0 0 10';
  163.     missile.velocity = dir * 400;
  164.     missile.avelocity = '300 300 300';
  165.     missile.nextthink = flytime + time;
  166.     missile.think = ShalHome;
  167.     missile.enemy = self.enemy;
  168.     missile.touch = ShalMissileTouch;
  169. };
  170.  
  171. void() ShalHome =
  172. {
  173.     local vector    dir, vtemp;
  174.     vtemp = self.enemy.origin + '0 0 10';
  175. //** PATCH_BEGIN - morph2 ****
  176.     if (!self.enemy)
  177.     {
  178.         return;
  179.     }
  180. //** PATCH_END - morph2 ******
  181.     if (self.enemy.health < 1)
  182.     {
  183.         remove(self);
  184.         return;
  185.     }
  186. //** PATCH_BEGIN - morph2 ****
  187.     self.nextthink = time + 0.2;
  188.     self.think = ShalHome;
  189.     // Go where last seen if not now visible
  190.     // For player and nightmare real monsters
  191.     if (self.owner.classname == "player" || skill == 3) if(!visible(self.enemy))
  192.         return;
  193. //** PATCH_END - morph2 ******
  194.     dir = normalize(vtemp - self.origin);
  195.     if (skill == 3)
  196.         self.velocity = dir * 350;
  197.     else
  198.         self.velocity = dir * 250;
  199. //** PATCH_BEGIN - morph2 ****
  200. //    self.nextthink = time + 0.2;
  201. //    self.think = ShalHome;
  202. //** PATCH_END - morph2 ******
  203. };
  204.  
  205. void() ShalMissileTouch =
  206. {
  207.     if (other == self.owner)
  208.         return;        // don't explode on owner
  209.  
  210.     if (other.classname == "monster_zombie")
  211.         T_Damage (other, self, self, 110);
  212.     T_RadiusDamage (self, self.owner, 40, world);
  213.     sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
  214.  
  215.     WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  216.     WriteByte (MSG_BROADCAST, TE_EXPLOSION);
  217.     WriteCoord (MSG_BROADCAST, self.origin_x);
  218.     WriteCoord (MSG_BROADCAST, self.origin_y);
  219.     WriteCoord (MSG_BROADCAST, self.origin_z);
  220.  
  221.     self.velocity = '0 0 0';
  222.     self.touch = SUB_Null;
  223.     setmodel (self, "progs/s_explod.spr");
  224.     self.solid = SOLID_NOT;
  225.     s_explode1 ();
  226. };
  227.  
  228. //=================================================================
  229.  
  230. /*QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 48) Ambush
  231. */
  232. void() monster_shalrath =
  233. {
  234.     if (deathmatch)
  235.     {
  236.         remove(self);
  237.         return;
  238.     }
  239.     precache_model2 ("progs/shalrath.mdl");
  240.     precache_model2 ("progs/h_shal.mdl");
  241.     precache_model2 ("progs/v_spike.mdl");
  242.     
  243.     precache_sound2 ("shalrath/attack.wav");
  244.     precache_sound2 ("shalrath/attack2.wav");
  245.     precache_sound2 ("shalrath/death.wav");
  246.     precache_sound2 ("shalrath/idle.wav");
  247.     precache_sound2 ("shalrath/pain.wav");
  248.     precache_sound2 ("shalrath/sight.wav");
  249.  
  250.     self.solid = SOLID_SLIDEBOX;
  251.     self.movetype = MOVETYPE_STEP;
  252.     
  253.     setmodel (self, "progs/shalrath.mdl");
  254.     setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  255.     self.health = 400;
  256.  
  257.     self.th_stand = shal_stand;
  258.     self.th_walk = shal_walk1;
  259.     self.th_run = shal_run1;
  260.     self.th_die = shalrath_die;
  261.     self.th_pain = shalrath_pain;
  262.     self.th_missile = shal_attack1;
  263.  
  264.     self.think = walkmonster_start;
  265.     self.nextthink = time + 0.1 + random ()*0.1;    
  266.  
  267. };
  268.